package model

import (
	"gorm.io/gorm"
	"time"
)

type Chat struct {
	Id        int64          `gorm:"column:id;type:bigint(20);primaryKey;not null;" json:"id"`
	People    string         `gorm:"column:people;type:varchar(255);comment:用户名;not null;" json:"people"` // 用户名
	Test      string         `gorm:"column:test;type:varchar(255);comment:聊天内容;not null;" json:"test"`    // 聊天内容
	Img       string         `gorm:"column:img;type:varchar(255);comment:图片;not null;" json:"img"`        // 图片
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (c *Chat) TableName() string {
	return "chat"
}
